package com.llly.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.llly.mapper.UserMapper;
import com.llly.pojo.Easybuy_order;
import com.llly.pojo.Easybuy_user;
import com.llly.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public Page<Easybuy_user> showUsers(Integer PageIndex) {
        Page<Easybuy_user> page= PageHelper.startPage(PageIndex==null?1:PageIndex,4);
        userMapper.showUsers();
        return page;
    }

    @Override
    public Easybuy_user loing(String loginName, String password) {
        Easybuy_user loing = userMapper.loing(loginName, password);
        return loing;
    }

    @Override
    public int AddEasybuy_user(Easybuy_user ea) {
        return userMapper.AddEasybuy_user(ea);
    }

    @Override
    public Easybuy_user iddetails(Integer id) {
        return userMapper.iddetails(id);
    }

    @Override
    public int updateUser(Easybuy_user ea) {
        return userMapper.updateUser(ea);
    }

    @Override
    public int deleteUsers(Integer id) {
        return userMapper.deleteUsers(id);
    }
}

